import { LOGIN_LOGOUT, LOGIN_START } from '../constants'

const initState = {
  // token: getToken(),
  token: '',
}
export default function login(state = initState, action) {
  switch (action.type) {
    case LOGIN_START:
      return {
        ...state,
        token: action.token,
      }
    case LOGIN_LOGOUT:
      return {
        ...state,
        token: '',
      }
    default:
      return state
  }
}
